package com.itany.springcloud.gateway.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;

//@Configuration
//@RibbonClient(name = "springcloud-ribbon",configuration = RibbonConfig.class)
public class RibbonConfig {

    @Bean
    public IRule ribbonRule(){

//        return new RoundRobinRule();
        return new RandomRule();
//        return new BestAvailableRule();
//        return new WeightedResponseTimeRule();
    }
}
